/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package edu.upn.sigemfi.can.be;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;

/**
 *
 * @author Programador
 */
@Entity
@Table(name = "CAN_TRANSACCION_GIRO_WEB")
@NamedQueries({@NamedQuery(name = "TransaccionGiroWeb.findAll", query = "SELECT t FROM TransaccionGiroWeb t"), @NamedQuery(name = "TransaccionGiroWeb.findByIdTransaccionGiroWeb", query = "SELECT t FROM TransaccionGiroWeb t WHERE t.idTransaccionGiroWeb = :idTransaccionGiroWeb"), @NamedQuery(name = "TransaccionGiroWeb.findByNombreDestinario", query = "SELECT t FROM TransaccionGiroWeb t WHERE t.nombreDestinario = :nombreDestinario"), @NamedQuery(name = "TransaccionGiroWeb.findByApellidoDestinatario", query = "SELECT t FROM TransaccionGiroWeb t WHERE t.apellidoDestinatario = :apellidoDestinatario"), @NamedQuery(name = "TransaccionGiroWeb.findByNumeroDocumentoDestinatario", query = "SELECT t FROM TransaccionGiroWeb t WHERE t.numeroDocumentoDestinatario = :numeroDocumentoDestinatario")})
public class TransaccionGiroWeb implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "ID_TRANSACCION_GIRO_WEB", nullable = false)
    @GeneratedValue(strategy=GenerationType.IDENTITY)
    private Long idTransaccionGiroWeb;
    @Column(name = "NOMBRE_DESTINARIO", length = 250)
    private String nombreDestinario;
    @Column(name = "APELLIDO_DESTINATARIO", length = 250)
    private String apellidoDestinatario;
    @Column(name = "NUMERO_DOCUMENTO_DESTINATARIO", length = 20)
    private String numeroDocumentoDestinatario;
    @JoinColumn(name = "FID_CAN_TIPO_DOCUMENTO", referencedColumnName = "ID_TIPO_DOCUMENTO")
    @ManyToOne(fetch = FetchType.LAZY)
    private TipoDocumento fidCanTipoDocumento;
    @JoinColumn(name = "FID_CAN_TRANSACCION_WEB", referencedColumnName = "ID_TRANSACCION_WEB")
    @ManyToOne(fetch = FetchType.LAZY)
    private TransaccionWeb fidCanTransaccionWeb;

    public TransaccionGiroWeb() {
    }

    public TransaccionGiroWeb(Long idTransaccionGiroWeb) {
        this.idTransaccionGiroWeb = idTransaccionGiroWeb;
    }

    public Long getIdTransaccionGiroWeb() {
        return idTransaccionGiroWeb;
    }

    public void setIdTransaccionGiroWeb(Long idTransaccionGiroWeb) {
        this.idTransaccionGiroWeb = idTransaccionGiroWeb;
    }

    public String getNombreDestinario() {
        return nombreDestinario;
    }

    public void setNombreDestinario(String nombreDestinario) {
        this.nombreDestinario = nombreDestinario;
    }

    public String getApellidoDestinatario() {
        return apellidoDestinatario;
    }

    public void setApellidoDestinatario(String apellidoDestinatario) {
        this.apellidoDestinatario = apellidoDestinatario;
    }

    public String getNumeroDocumentoDestinatario() {
        return numeroDocumentoDestinatario;
    }

    public void setNumeroDocumentoDestinatario(String numeroDocumentoDestinatario) {
        this.numeroDocumentoDestinatario = numeroDocumentoDestinatario;
    }

    public TipoDocumento getFidCanTipoDocumento() {
        return fidCanTipoDocumento;
    }

    public void setFidCanTipoDocumento(TipoDocumento fidCanTipoDocumento) {
        this.fidCanTipoDocumento = fidCanTipoDocumento;
    }

    public TransaccionWeb getFidCanTransaccionWeb() {
        return fidCanTransaccionWeb;
    }

    public void setFidCanTransaccionWeb(TransaccionWeb fidCanTransaccionWeb) {
        this.fidCanTransaccionWeb = fidCanTransaccionWeb;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idTransaccionGiroWeb != null ? idTransaccionGiroWeb.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof TransaccionGiroWeb)) {
            return false;
        }
        TransaccionGiroWeb other = (TransaccionGiroWeb) object;
        if ((this.idTransaccionGiroWeb == null && other.idTransaccionGiroWeb != null) || (this.idTransaccionGiroWeb != null && !this.idTransaccionGiroWeb.equals(other.idTransaccionGiroWeb))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "edu.upn.sigemfi.can.be.TransaccionGiroWeb[idTransaccionGiroWeb=" + idTransaccionGiroWeb + "]";
    }

}
